package com.hxjb.service.impl;

import com.huamo.base.dao.BaseDao;
import com.hxjb.entity.User;
import com.hxjb.service.IDynamicDSTestService;
import com.hxjb.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by wt on 2017/12/1.
 */
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private BaseDao baseDao;
    @Autowired
    private IDynamicDSTestService dynamicDSTestService;

    @Override
    public void updateCityidById2(User user4Update) {

        baseDao.update("UserMapper.updateCityidById", user4Update);

        int i = 1 / 0;
    }

    @Override
//    @Transactional
    public void testTransactionalByMethodInMethod(User user) {
        baseDao.update("UserMapper.updateCityidById", user);
        dynamicDSTestService.updateEmailByUserId(user);
        int i = 1 / 0;
    }
}
